<template>
  <view>
    <view v-for="(item,index) in campus" :key="index">
      <uni-card :cover="item.img" @click="goCampus(item.value)">
        <!-- <image slot='cover' style="width: 100%;" :src="cover"></image> -->
        <text class="uni-body">{{item.name}}</text>

      </uni-card>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        campus: [{
          img: "/static/img/JiangWan.jpg",
          name: "江湾校区",
          value: "JiangWan"
        }, {
          img: "/static/img/HanDan.jpg",
          name: "邯郸校区",
          value: "HanDan"
        }, {
          img: "/static/img/FengLin.jpg",
          name: "枫林校区",
          value: "FengLin"
        }, {
          img: "/static/img/ZhangJiang.jpg",
          name: "张江校区",
          value: "ZhangJiang"
        }]
      };
    },
    onLoad() {
      wx.setStorageSync("iseats_campus",this.campus)
    },
    methods: {
      goCampus(value) {
        uni.navigateTo({
          url: `/subpkg/campusDetail/campusDetail?campus=${value}`,
        })
      },

    }

  }
</script>

<style lang="scss">

</style>